<html>
<head><meta charset="utf-8"><title>Dumping pre-optimized MIR? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Dumping.20pre-optimized.20MIR.3F.html">Dumping pre-optimized MIR?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="182447266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Dumping%20pre-optimized%20MIR%3F/near/182447266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Dumping.20pre-optimized.20MIR.3F.html#182447266">(Dec 03 2019 at 13:25)</a>:</h4>
<p>As far as I can see -Z flags for dumping MIR print post-optimization MIRs, is there a way to see MIR <em>before</em> optimizations?</p>



<a name="182447893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Dumping%20pre-optimized%20MIR%3F/near/182447893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Dumping.20pre-optimized.20MIR.3F.html#182447893">(Dec 03 2019 at 13:31)</a>:</h4>
<p>You want to use the <code>-Z dump-mir</code> flag.</p>



<a name="182447942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Dumping%20pre-optimized%20MIR%3F/near/182447942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Dumping.20pre-optimized.20MIR.3F.html#182447942">(Dec 03 2019 at 13:32)</a>:</h4>
<p>Which will dump the MIR before and after each pass</p>



<a name="182447969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Dumping%20pre-optimized%20MIR%3F/near/182447969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Dumping.20pre-optimized.20MIR.3F.html#182447969">(Dec 03 2019 at 13:32)</a>:</h4>
<p><a href="https://rust-lang.github.io/rustc-guide/mir/debugging.html" target="_blank" title="https://rust-lang.github.io/rustc-guide/mir/debugging.html">https://rust-lang.github.io/rustc-guide/mir/debugging.html</a></p>



<a name="182448177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Dumping%20pre-optimized%20MIR%3F/near/182448177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Dumping.20pre-optimized.20MIR.3F.html#182448177">(Dec 03 2019 at 13:35)</a>:</h4>
<p>Oh, I tried that flag but couldn't understand the output. That page is very helpful, thanks.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>